-
Notifications
You must be signed in to change notification settings - Fork 17.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
AP_Baro:add driver for the SPA06 #27905
Conversation
Needs to compile This looks very similar to the SPL06 driver. This looks like we should be re-using the SPLP06 driver for the SPA, particularly if they can be distinguished by their WHOAMI registers or some other fingerprinting we can do. We seriously can't afford to copy a driver sideways - we're fast running out of flash on boards, and baros make their way into a lot of boards. Can you think about whether it would be possible to augment the SPL driver, please? I'm happy to take this to a DevCall to see if other devs disagree, but I don't think they will. |
I also think it should be made into a driver, but the class name should not be SPL06. |
Yes indeed, you could rename |
To be clear, if you rename a file, to it in a completely separate commit to everything else, including adjusting |
9ba6de6
to
1aeb373
Compare
@peterbarker The SPA06 and SPL06 baro have been merged into an SPx06 driver and tested for narmal flight on the latest Copter4.5 branch. |
f3a351f
to
c4dcbba
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Partial review only.
This is looking good. I might look at pulling out the renaming into a separate PR as, based on your work here, re-using the same code for the two devices it viable.
does this need an extract_features.py update or will a REGEX catch the change? |
It should be updated, I replaced everything related to SPL06 with SPx06. |
Updated and committed. |
@radiolinkW I've extracted those rename commits over here: https://github.com/ArduPilot/ardupilot/pull/27992/commits - I should be able to get that in soon which will let me take this to DevCallEU tomorrow for a merge, hopefully. |
Thanks, won't the other three commits be merged? |
Oh yes - but we'll get the other ones in first. That will make this one much easier to review on a DevCall to get it merged. |
c20c1f8
to
b158398
Compare
Unfortunately we both got this wrong, as it turns out. tridge was very resistant to renaming this driver, and gave several good reasons why it would be a bad idea - mostly breaking things out-of-tree. He pointed out several places in our codebase where we simply add comments indicating what devices a driver handles. I've taken the liberty of removing the rename of the files and the rename of the class commits from your branch and fixing the conflicts I've force-pushed over your branch here. If you're happy to proceed from this point I'll leave a review so we can get this merged... also, testing that I haven't broken anything when I resolved those conflicts would be a good idea! |
That's also good, there won't be much change. But I didn't see a comment in the top of the SPL06 driver saying it supports SPA06 as well, also, RadiolinkPIX6 does not enable Background mode by default. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have you tested an SPL06 device to ensure it continues to function normally after these changes?
Please outline the advantages of using the "background" mode of the SPA06...
b158398
to
b69e141
Compare
Updated and committed. |
The latest commit has been tested for narmal flight on the latest Copter4.5 branch. Background mode only measures continuously, without manually enabling measurements periodically. |
@radiolinkW have you tested a device with an SPL06 in it? I'm marking this for discussion DevCallEU, and that question will be asked :-) |
I've tested this on a MatekH7A6 which has an SPL06 baro on it - no functionality change I could see. |
Tested on RadiolinkPIX6 with SPA06 and flying normally. |
Merged, thanks! |
Thanks! @peterbarker @tridge |
Hello, does this change also influence the SPL001 update rate? I have Baro-0 /Baro-4 i.e. Baro Bad Health issues on a plane while circling over a field for 30minutes and I believe it is due to the baro having the same value for 2 seconds. Meaning to ask, does it make sense to test with AP4.6Beta1 or write an Issue Report directly? |
The SPA06 is a high resolution low noise barometer pin-to-pin compatible with the SPL06.
I have been flight testing this baro on RadiolinkPIX6 and driver it seems to work well.
Here is the datasheet: SPA06-003_datasheet.pdf